<?php

class BcModeHandler implements ModeHandler
{
	public function __construct ()
	{
		bcscale(10);
	}

	public function handleResult ($result, CliContext $context)
	{
		return $result;
	}

	public function getInt ($number)
	{
		return new BcModeNumber($number);
	}

	public function getFloat ($number)
	{
		$number = CliLib::expandFloat($number);
		return new BcModeNumber($number);
	}

	public function getModeNumber ($number)
	{
		if (is_float($number))
		{
			$number = CliLib::expandFloat($number);
		}

		return new BcModeNumber((string) $number);
	}
}

?>